package com.example.svtripsapp;


import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.Gallery;
import android.widget.Toast;

public class MainPlace extends Activity{
	
	//Button back, home, forward;
	
	@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main_place);
    
        Gallery gallery = (Gallery)findViewById(R.id.gallery);
        gallery.setAdapter(new ImageAdapter(this));
        
        gallery.setOnItemClickListener(new OnItemClickListener (){
        	public void onItemClick(AdapterView parent, View v, int position, long id){
        		Toast.makeText(MainPlace.this, "" + position, Toast.LENGTH_SHORT).show();
        	}
        });
        	
        	
        	
        
       
   /*       back = (Button) findViewById(R.id.botonAtras);
        
		back.setOnClickListener(this);
		home = (Button) findViewById(R.id.botonInicio);
		home.setOnClickListener(this);
		forward = (Button) findViewById(R.id.botonAdelante);
		forward.setOnClickListener(this);
		
		
	    webView = (WebView) findViewById(R.id.webview1);
		
	    webView.setWebViewClient(new WebViewClient(){
			//Evita que los enlaces se abran fuera de la app

			@Override
			public boolean shouldOverrideUrlLoading(WebView view, String url) {
				// TODO Auto-generated method stub
				return false;
			}
		});
		
		WebSettings webSettings = webView.getSettings();
		webSettings.setBuiltInZoomControls(true);
		webSettings.setJavaScriptEnabled(true);
		
		webView.loadUrl(HOME);
     */   
	}

	//@Override
	//public void onClick(AdapterView parent, ) {
		// TODO Auto-generated method stub
		
	//}

	//@Override
	//public void onClick(View v) {
		//switch(v.getId()){
		/*case R.id.botonAtras:
			webView.goBack();
			break;
		case R.id.botonAdelante:
			webView.goForward();
			break;
		case R.id.botonInicio:
			webView.loadUrl(HOME);
			break;
			default:
				break;*/
		//}
		
	//}
	
	
}
